(if (string-equal system-type "windows-nt")
;;window下的配置
(progn
;; 最大化窗口
(defun maximize-frame ()
"Maximize the current frame"
(interactive)
(w32-send-sys-command 61488))

;; 最小化窗口
(defun minimize-frame ()
"Maximize the current frame"
(interactive)
(w32-send-sys-command 61472))

;; 还原最大化窗口
(defun restore-frame ()
"Restore a minimized frame"
(interactive)
(w32-send-sys-command 61728))
)

;; w32-send-sys-command Codesp
;; 61440 - resize the window via keyboard
;; 61456 - move window via keyboard
;; 61472 - minimize current frame
;; 61488 - maximize current frame
;; 61504 - next window (not very practical)
;; 61520 - previous window (not very practical)
;; 61536 - close the window (this will quit the application)
;; 61552 - vertical scroll – doesn’t seem to do anything for me
;; 61568 - horizontal scroll – doesn’t seem to do anything for me
;; 61584 - mouse menu(?) – doesn’t seem to do anything for me
;; 61696 - activate menubar (will not de-activate it, though)
;; 61712 - arrange(?) – doesn’t seem to do anything for me
;; 61728 - restore current frame
;; 61744 - simulate pressing Windows Start button
;; 61760 - activate screensaver
;; 61776 - hotkey(?) – doesn’t seem to do anything for me
(if (string-equal system-type "gnu/linux")
(progn
;; Using the maxframe.el which can be install from pakcage
;; There is no minimize command in the maxframe.el
(require 'maxframe)

))
)

(global-set-key (kbd "C-x C-1") 'maximize-frame)
(global-set-key (kbd "C-x C-2") 'minimize-frame)
(global-set-key (kbd "C-x C-3") 'restore-frame) 
